/*
 * @Author: your name
 * @Date: 2021-06-25 09:59:16
 * @LastEditTime: 2021-06-25 10:37:31
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \nest_demo\src\queue\audio.module.ts
 */
import { BullModule } from '@nestjs/bull';
import { Module } from '@nestjs/common';
import { ConfigService } from 'nestjs-config';
import { AudioController } from './audio.controller';
import { AudioProcessor } from './audio.processor';

@Module({
  imports: [
    BullModule.registerQueueAsync({ // 注册一个'audio'的队列
      name: 'audio',
      useFactory: (config: ConfigService) => ({
        redis: config.get('redis')
      }),
      inject: [ConfigService]
    }),
  ],
  controllers: [AudioController],
  providers: [AudioProcessor],
})
export class AudioModule {}
